<template>
  <div id="page">
    <div class="title">提现账号</div>
    <p>
      <input v-model="zfbName" type="text" placeholder="支付宝名称">
    </p>
    <p style="margin-top: 0.3rem">
      <input v-model="zfbAccount" type="number" placeholder="支付宝账号">
    </p>
    <div @click="revisebtn" class="btn flex-grow-0 flex-x-center flex-y-center"> 确定修改</div>
  </div>
</template>
<script>
  import {GETUSERZFBINFO,UPDATEZFBINFO} from 'src/const/uri'
  export default{

    data(){
      return {
        zfbName:'',
        zfbAccount:'',
        pageData:[]
      }
    },
    mounted(){
      this.initData();
      let spinner = document.getElementsByClassName('spinner')[0];
      spinner.style.display = 'none';
    },
    methods:{
      initData(){
        this.$ajax.get(GETUSERZFBINFO,{},(res)=>{
          this.pageData=res.data;
          this.zfbAccount=res.data.zfbAccount;
          this.zfbName=res.data.zfbName;
          //console.log(this.pageData)
        })
      },
      revisebtn(){
        if(this.zfbName && this.zfbAccount){
          this.$ajax.post(UPDATEZFBINFO,{
            zfbAccount:this.zfbAccount,
            zfbName:this.zfbName
          },(res)=>{
            this.$vux.toast.show({
              text:'修改成功'
            });
          });
        }

      },
      refreshData(responseCallback) {
        this.initData();
        responseCallback({code: '0'});
      },
    }
  }
</script>
<style lang="less" scoped>
  @import "index";
</style>
